import { Controller, Get, Post, Body, Param, Delete, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { CouponUserClient_Service } from './couponUserClient.service';
import { CouponUserClient_Create_Dto, CouponUserClient_Update_Dto } from './assets/couponUserClient.dto';
import { CouponUserClient_Find_Dto } from './assets/couponUserClient.dto';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { util_Index_ReturnContent } from '@/common/util/index';
import { Constant_Enum_Name_CouponUserClient_Status } from '@/common/constants/enum';

@Controller('/adm/couponUserClient')
@ApiTags('couponUserClient 优惠券领取列表')
export class CouponUserClient_Controller {
  constructor(private readonly couponUserClient_Service: CouponUserClient_Service) {}

  @Post('/add')
  @util_ApiResponse_Base({
    dataType: 'dataType_add',
  })
  async couponUserClient_Create(@Body() body: CouponUserClient_Create_Dto) {
    return util_Index_ReturnContent(await this.couponUserClient_Service.couponUserClient_Create(body));
  }

  @Get('/list')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
    description: '查询列表 状态值' + Constant_Enum_Name_CouponUserClient_Status,
  })
  async couponUserClient_FindByPage(@Query() query: CouponUserClient_Find_Dto) {
    return util_Index_ReturnContent(
      await this.couponUserClient_Service.couponUserClient_FindByPage(query),
    );
  }

  @Put('/update')
  @util_ApiResponse_Base({
    dataType: 'dataType_update',
  })
  async couponUserClient_Update(@Body() body: CouponUserClient_Update_Dto) {
    return util_Index_ReturnContent(await this.couponUserClient_Service.couponUserClient_Update(body));
  }

  @Delete('/delete/:id')
  @util_ApiResponse_Base({
    dataType: 'dataType_delete',
  })
  async couponUserClient_Remove(@Param('id') id: string) {
    return util_Index_ReturnContent(await this.couponUserClient_Service.couponUserClient_Remove(+id));
  }
}
